<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class systemAction extends publicAction{
    public function dataBack(){
        $filename=$_POST['filename'];
        $path="/databack/".$filename;
        $res=exec("mysqldump -uroot -proot  --default_charset=utf8 bbs >".$path);
        if($res){
            $this->assign('msg',"<font color='green'>备份数据成功</font>");
            $this->display();
            exit();
        }  else {
            $this->assign('msg',"<font color='red'>备份数据失败</font>");
            $this->display();
            exit();
        }
    }
}
?>
